package com.ibm.spatiotemp.server.datasources.fake;

import java.util.Collection;

import org.apache.log4j.Logger;

import com.ibm.spatiotemp.server.datamodel.gpsdata.TSPoint;
import com.ibm.spatiotemp.server.datamodel.gpsdata.TSPointResultSet;
import com.ibm.spatiotemp.server.datamodel.gpsdata.fake.FakeTSPointResultSet;
import com.ibm.spatiotemp.server.datasources.DataSource;
import com.ibm.spatiotemp.server.datasources.RawDataAccessor;
import com.ibm.spatiotemp.server.framework.request.Request;

public class FakeRawDataAccessor  extends RawDataAccessor{
	public static Logger logger = Logger.getLogger(FakeRawDataAccessor.class);

	public FakeRawDataAccessor(
			DataSource src) {
		super(src);
		queryformatter = new FakeQueryStringFormatter();
	}

	@Override
	public void connect() throws Exception {
		logger.info("connected to db");
	}

	@Override
	public void close() throws Exception {
		logger.info("closed");
	}

	@Override
	public TSPointResultSet ScanGPSData(String query_string) throws Exception {
		logger.info("querystring:"+query_string);
		return new FakeTSPointResultSet();
	}

	@Override
	public int WriteGPSData(String query_string, Collection<TSPoint> tsp_data) throws Exception {
		logger.info("querystring:"+query_string);
		return 0;
	}

	@Override
	public TSPointResultSet ScanGPSData(Request request) throws Exception {
		logger.info("ScanGPSData:"+request.toJsonString());
		return new FakeTSPointResultSet();
	}

}
